package com.cykj.service.Impl;

import com.cykj.dto.ResponseDto;
import com.cykj.mapper.ConsultingRecordMapper;
import com.cykj.pojo.PsConsultingRecord;
import com.cykj.service.ConsultingRecordService;
import com.cykj.vo.ConsultingRecordVo;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @BelongsProject: Psychology
 * @BelongsPackage: com.cykj.service.Impl
 * @Author: 小林
 * @CreateTime: 2025-02-17 00:14
 * @Description:  评估表service层
 * @Version: 1.0
 */
@Service
public class ConsultingRecordServiceImpl implements ConsultingRecordService {
    @Autowired
    private ConsultingRecordMapper consultingRecordMapper;
    //获取全部记录
    @Override
    public ResponseDto getAll(ConsultingRecordVo vo) {
        PageHelper.startPage(vo.getPageNum(),vo.getPageSize());
        final List<PsConsultingRecord> all = consultingRecordMapper.getAll(vo);
        PageInfo<PsConsultingRecord> pageInfo = new PageInfo<>(all);
        return pageInfo!=null?ResponseDto.success(pageInfo):ResponseDto.error("查询失败");
    }
}

